import request from "./request";
const Req = new request()
export function list(page = 0, limit = 10) {
    return Req.get({
        url: '/orderList',
        data: {
            page,
            limit
        }
    })
}
export function search(ordersn, tel, time) {
    let data = {};
    if (ordersn) {
        data.ordersn = ordersn
    } else {
        let beginTime = time[0];
        let endTime = time[1];
        if (tel && beginTime) {
            data.tel = tel
            data.beginTime = beginTime
            data.endTime = endTime
        } else if (tel) {
            data.tel = tel;
        } else if (beginTime) {
            data.beginTime = beginTime
            data.endTime = endTime
        } else {
            // 报错
        }

    }
    return Req.post({
        url: '/searchOrder',
        data: data
    })
}
export function remove(_id) {
    return Req.post({
        url: '/orderRemove',
        data: {
            _id
        }
    })
}
export function send(_id, sendno) {
    return Req.post({
        url: "/setSendNo",
        data: {
            _id,
            sendno
        }
    })
}
